package cn.xfdzx.android.apps.shop.contract;

import java.util.Map;

import cn.xfdzx.android.apps.shop.base.BaseView;
import cn.xfdzx.android.apps.shop.bean.ConfirmGoodBeen;
import cn.xfdzx.android.apps.shop.bean.HomeSearchRetailGoodsBean;
import cn.xfdzx.android.apps.shop.bean.HomeSearchXFDGoodBeen;
import cn.xfdzx.android.apps.shop.bean.HotSearchBeen;
import cn.xfdzx.android.apps.shop.bean.HotSearchRetailBean;
import cn.xfdzx.android.apps.shop.bean.SearchBeen;
import cn.xfdzx.android.apps.shop.bean.SearchShopBean;
import cn.xfdzx.android.apps.shop.bean.XFDGoodsDetailsBeen;
import io.reactivex.Flowable;


/**
 * @author azheng
 * @date 2018/6/4.
 * Description：
 */

public interface HomeSearchContract {
    interface Model {
        Flowable<HotSearchBeen> initHotSearch();
        Flowable<SearchBeen> initData(String keyword,String indexStatus,String user_current_lng,String user_current_lat);
        Flowable<HomeSearchXFDGoodBeen> initSearchData(String lng,  String lat,String sid, String page, String limit,
                                                       String index_status, String is_store, String store_id, String keyword,
                                                       String priceOrder, String salesOrder, String news);


        Flowable<SearchShopBean> getSearchShopList(Map<String,Object> map);
        Flowable<HomeSearchRetailGoodsBean> getSearchGoodsList(Map<String,Object> map);
        Flowable<ConfirmGoodBeen> addCar(Map<String,Object> map);
        Flowable<HotSearchRetailBean> getRetailHotSearch();
    }

    interface View extends BaseView {
        @Override
        void showLoading();

        @Override
        void hideLoading();

        @Override
        void onError(Throwable throwable);

        void onInitDataSuccess(SearchBeen bean);
        void onHotSearchSuccess(HotSearchBeen bean);
        void onInitSearchDataSuccess(HomeSearchXFDGoodBeen bean);

        void onGetSearchShopListSuccess(SearchShopBean bean);
        void onGetSearchGoodsListSuccess(HomeSearchRetailGoodsBean bean);
        void onAddCarSuccess(ConfirmGoodBeen bean);
        void onGetRetailHotSearchSuccess(HotSearchRetailBean bean);
        /**
         * 刷新完成
         */
        void finishRefresh();

        /**
         * 加载完成
         */
        void finishLoadMore();
    }

    interface Presenter {
        /**
         *  初始化数据
         */
        void initData(String keyword,String indexStatus,String user_current_lng,String user_current_lat);
        void initHotSearch();
        void initSearchData(boolean isRefresh,boolean isLoading,String lng,  String lat,String sid,String page,String limit,String index_status,String is_store,String store_id,String keyword,String priceOrder,String salesOrder,String news);
        void getSearchShopList(Map<String,Object> map);
        void getSearchGoodsList(boolean isRefresh,boolean isLoading,Map<String,Object> map);
        void addCar(Map<String,Object> map);
        void getRetailHotSearch();
    }
}
